if (this._shutdownTimeoutId)
GLib.source_remove(this._shutdownTimeoutId);
- this._shutdownTimeoutId = GLib.timeout_add_seconds(
+ this._shutdownTimeoutId = GLib.timeout_add_seconds_once(
GLib.PRIORITY_DEFAULT, IDLE_SHUTDOWN_TIME,
() => {
this._shutdownTimeoutId = 0;
this._maybeShutdown();
-
- return GLib.SOURCE_REMOVE;
});
}
set_titlebar() {
// intercept fatal libadwaita error, show error page instead
- GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
this._showErrorPage(
new Error('set_titlebar() is not supported for Adw.Window'));
- return GLib.SOURCE_REMOVE;
});
}
}
});
} else {
- const id = GLib.idle_add(GLib.PRIORITY_DEFAULT, this._loadUserList.bind(this));
+ const id = GLib.idle_add_once(GLib.PRIORITY_DEFAULT, this._loadUserList.bind(this));
GLib.Source.set_name_by_id(id, '[gnome-shell] _loadUserList');
}
}
}
}, conflictingSessionDialog);
- const closeDialogTimeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, _CONFLICTING_SESSION_DIALOG_TIMEOUT, () => {
+ const closeDialogTimeoutId = GLib.timeout_add_seconds_once(GLib.PRIORITY_DEFAULT, _CONFLICTING_SESSION_DIALOG_TIMEOUT, () => {
this._notifyConflictingSessionDialogClosed();
conflictingSessionDialog.close();
this._authPrompt.reset();
- return GLib.SOURCE_REMOVE;
});
conflictingSessionDialog.connect('closed', () => {
_blockTimedLoginUntilIdle() {
const hold = new Batch.Hold();
- this._timedLoginIdleTimeOutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, _TIMED_LOGIN_IDLE_THRESHOLD,
+ this._timedLoginIdleTimeOutId = GLib.timeout_add_seconds_once(GLib.PRIORITY_DEFAULT, _TIMED_LOGIN_IDLE_THRESHOLD,
() => {
this._timedLoginIdleTimeOutId = 0;
hold.release();
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._timedLoginIdleTimeOutId, '[gnome-shell] this._timedLoginIdleTimeOutId');
return hold;
_loadUserList() {
if (this._userListLoaded)
- return GLib.SOURCE_REMOVE;
+ return;
this._userListLoaded = true;
this._userList.addUser(user);
this._updateDisableUserList();
}, this);
-
- return GLib.SOURCE_REMOVE;
}
activate() {
delete this._currentMessageExtraInterval;
this.emit('show-message', message.serviceName, message.text, message.type);
- this._messageQueueTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
+ this._messageQueueTimeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT,
message.interval + (this._currentMessageExtraInterval | 0), () => {
this._messageQueueTimeoutId = 0;
} else {
this.finishMessageQueue();
}
-
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._messageQueueTimeoutId, '[gnome-shell] this._queueMessageTimeout');
}
GLib.source_remove(this._fingerprintFailedId);
const cancellable = this._cancellable;
- this._fingerprintFailedId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
+ this._fingerprintFailedId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT,
FINGERPRINT_ERROR_TIMEOUT_WAIT, () => {
this._fingerprintFailedId = 0;
if (!cancellable.is_cancelled())
this._verificationFailed(serviceName, false);
- return GLib.SOURCE_REMOVE;
});
}
}
if (this._countdownTimerId !== 0)
GLib.source_remove(this._countdownTimerId);
- this._countdownTimerId = GLib.timeout_add_seconds(
+ this._countdownTimerId = GLib.timeout_add_seconds_once(
GLib.PRIORITY_DEFAULT,
countdownStart, () => {
if (this._countdownOsd == null) {
() => (this._countdownOsd = null));
}
this._countdownTimerId = 0;
- return GLib.SOURCE_REMOVE;
});
}
console.debug(`BreakNotificationSource: Scheduling notification state update in ${timeoutSeconds}s`);
- this._timerId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, timeoutSeconds, () => {
+ this._timerId = GLib.timeout_add_seconds_once(GLib.PRIORITY_DEFAULT, timeoutSeconds, () => {
this._timerId = 0;
console.debug('BreakNotificationSource: Scheduled notification state update');
this._updateState();
- return GLib.SOURCE_REMOVE;
});
}
}
this._preloadEnginesId =
- GLib.timeout_add_seconds(
+ GLib.timeout_add_seconds_once(
GLib.PRIORITY_DEFAULT,
this._PRELOAD_ENGINES_DELAY_TIME,
() => {
this._cancellable,
null);
this._preloadEnginesId = 0;
- return GLib.SOURCE_REMOVE;
});
}
this._preeditStr = null;
}
- this._hidePanelId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, HIDE_PANEL_TIME, () => {
+ this._hidePanelId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, HIDE_PANEL_TIME, () => {
this.set_input_panel_state(Clutter.InputPanelState.OFF);
this._hidePanelId = 0;
- return GLib.SOURCE_REMOVE;
});
}
console.debug(`TimeLimitsNotificationSource: Scheduling notification state update in ${timeoutSeconds}s`);
- this._timerId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, timeoutSeconds, () => {
+ this._timerId = GLib.timeout_add_seconds_once(GLib.PRIORITY_DEFAULT, timeoutSeconds, () => {
this._timerId = 0;
console.debug('TimeLimitsNotificationSource: Scheduled notification state update');
this._updateState();
- return GLib.SOURCE_REMOVE;
});
}
const seconds =
(CONNECTIVITY_RECHECK_RATELIMIT_TIMEOUT - timeSinceLastRecheck) /
GLib.USEC_PER_SEC;
- this._recheckTimeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, seconds, () => {
+ this._recheckTimeoutId = GLib.timeout_add_seconds_once(GLib.PRIORITY_DEFAULT, seconds, () => {
this._statusChangedCallback(PortalHelperResult.RECHECK);
this._recheckTimeoutId = 0;
- return GLib.SOURCE_REMOVE;
});
}
}
this._thumbnails.highlight(window, forceAppFocus);
} else if (this._items[this._selectedIndex].cachedWindows.length > 1 &&
!forceAppFocus) {
- this._thumbnailTimeoutId = GLib.timeout_add(
+ this._thumbnailTimeoutId = GLib.timeout_add_once(
GLib.PRIORITY_DEFAULT,
THUMBNAIL_POPUP_TIME,
this._timeoutPopupThumbnails.bind(this));
this._createThumbnails();
this._thumbnailTimeoutId = 0;
this._thumbnailsFocused = false;
- return GLib.SOURCE_REMOVE;
}
_destroyThumbnails() {
if (this._altTabPopup.thumbnailsVisible) {
this._delayedHighlighted = index;
- this._mouseTimeOutId = GLib.timeout_add(
+ this._mouseTimeOutId = GLib.timeout_add_once(
GLib.PRIORITY_DEFAULT,
APP_ICON_HOVER_TIMEOUT,
() => {
this._enterItem(index);
this._delayedHighlighted = -1;
this._mouseTimeOutId = 0;
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._mouseTimeOutId, '[gnome-shell] this._enterItem');
} else {
this.goToPage(nextPage);
this._canScroll = false;
- this._scrollTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
+ this._scrollTimeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT,
SCROLL_TIMEOUT_TIME, () => {
this._canScroll = true;
this._scrollTimeoutId = 0;
- return GLib.SOURCE_REMOVE;
});
return Clutter.EVENT_STOP;
position,
source,
destroyId: source.connect('destroy', () => this._removeDelayedMove()),
- timeoutId: GLib.timeout_add(GLib.PRIORITY_DEFAULT,
+ timeoutId: GLib.timeout_add_once(GLib.PRIORITY_DEFAULT,
DELAYED_MOVE_TIMEOUT, () => {
this._moveItem(source, page, position);
this._delayedMoveData.timeoutId = 0;
this._removeDelayedMove();
- return GLib.SOURCE_REMOVE;
}),
};
}
const {targetActor} = dragEvent;
this._dragPageSwitchInitialTimeoutId =
- GLib.timeout_add(GLib.PRIORITY_DEFAULT, DRAG_PAGE_SWITCH_INITIAL_TIMEOUT, () => {
+ GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, DRAG_PAGE_SWITCH_INITIAL_TIMEOUT, () => {
const direction = targetActor === this._prevPageIndicator ? -1 : 1;
this.goToPage(this._grid.currentPage + direction);
this._setupDragPageSwitchRepeat(direction);
delete this._dragPageSwitchInitialTimeoutId;
- return GLib.SOURCE_REMOVE;
});
}
return;
this._popdownTimeoutId =
- GLib.timeout_add(GLib.PRIORITY_DEFAULT, POPDOWN_DIALOG_TIMEOUT, () => {
+ GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, POPDOWN_DIALOG_TIMEOUT, () => {
this._popdownTimeoutId = 0;
this.popdown();
- return GLib.SOURCE_REMOVE;
});
}
return;
this._folderPreviewId =
- GLib.timeout_add(GLib.PRIORITY_DEFAULT, 500, () => {
+ GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, 500, () => {
this.add_style_pseudo_class('drop');
this._showFolderPreview();
this._folderPreviewId = 0;
- return GLib.SOURCE_REMOVE;
});
} else {
if (this._folderPreviewId > 0) {
let animation = this._animations[params.settingsSchema];
if (animation && _fileEqual0(animation.file, params.file)) {
if (params.onLoaded) {
- const id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ const id = GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
params.onLoaded(this._animations[params.settingsSchema]);
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(id, '[gnome-shell] params.onLoaded');
}
this._animations[params.settingsSchema] = animation;
if (params.onLoaded) {
- const id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ const id = GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
params.onLoaded(this._animations[params.settingsSchema]);
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(id, '[gnome-shell] params.onLoaded');
}
if (this._changedIdleId)
return;
- this._changedIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ this._changedIdleId = GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
this._changedIdleId = 0;
this.emit('bg-changed');
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._changedIdleId,
'[gnome-shell] Background._emitChangedSignal');
if (this._cancellable?.is_cancelled())
return;
- const id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ const id = GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
this.emit('loaded');
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(id, '[gnome-shell] Background._setLoaded Idle');
}
if (interval > GLib.MAXUINT32)
return;
- this._updateAnimationTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
+ this._updateAnimationTimeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT,
interval,
() => {
this._updateAnimationTimeoutId = 0;
this._updateAnimation();
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._updateAnimationTimeoutId, '[gnome-shell] this._updateAnimation');
}
});
this.content.background = _systemBackground;
- const id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ const id = GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
this.emit('loaded');
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(id, '[gnome-shell] SystemBackground.loaded');
}
let loadedSignalId;
if (background.isLoaded) {
- GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
this.emit('loaded');
- return GLib.SOURCE_REMOVE;
});
} else {
loadedSignalId = background.connect('loaded', () => {
'drive-disconnected', this._onDriveDisconnected.bind(this),
'drive-eject-button', this._onDriveEjectButton.bind(this), this);
- this._mountAllId = GLib.idle_add(GLib.PRIORITY_DEFAULT, this._startupMountAll.bind(this));
+ this._mountAllId = GLib.idle_add_once(GLib.PRIORITY_DEFAULT, this._startupMountAll.bind(this));
GLib.Source.set_name_by_id(this._mountAllId, '[gnome-shell] this._startupMountAll');
}
});
this._mountAllId = 0;
- return GLib.SOURCE_REMOVE;
}
_onDriveConnected() {
}
_allowAutorunExpire(volume) {
- const id = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, AUTORUN_EXPIRE_TIMEOUT_SECS, () => {
+ const id = GLib.timeout_add_seconds_once(GLib.PRIORITY_DEFAULT, AUTORUN_EXPIRE_TIMEOUT_SECS, () => {
volume.allowAutorun = false;
delete volume._allowAutorunExpireId;
- return GLib.SOURCE_REMOVE;
});
volume._allowAutorunExpireId = id;
GLib.Source.set_name_by_id(id, '[gnome-shell] volume.allowAutorun');
this._sessionRequestTimeoutId = 0;
if (this.state !== ModalDialog.State.OPENED)
- return GLib.SOURCE_REMOVE;
+ return;
this._passwordEntry.hide();
this._cancelButton.grab_key_focus();
this._okButton.reactive = false;
-
- return GLib.SOURCE_REMOVE;
};
if (delay) {
- this._sessionRequestTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, delay, resetDialog);
+ this._sessionRequestTimeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, delay, resetDialog);
GLib.Source.set_name_by_id(this._sessionRequestTimeoutId, '[gnome-shell] this._sessionRequestTimeoutId');
} else {
resetDialog();
if (shouldShow) {
if (this._showLabelTimeoutId === 0) {
const timeout = this._labelShowing ? 0 : DASH_ITEM_HOVER_TIMEOUT;
- this._showLabelTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, timeout,
+ this._showLabelTimeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, timeout,
() => {
this._labelShowing = true;
item.showLabel();
this._showLabelTimeoutId = 0;
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._showLabelTimeoutId, '[gnome-shell] item.showLabel');
if (this._resetHoverTimeoutId > 0) {
this._showLabelTimeoutId = 0;
item.hideLabel();
if (this._labelShowing) {
- this._resetHoverTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, DASH_ITEM_HOVER_TIMEOUT,
+ this._resetHoverTimeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, DASH_ITEM_HOVER_TIMEOUT,
() => {
this._labelShowing = false;
this._resetHoverTimeoutId = 0;
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._resetHoverTimeoutId, '[gnome-shell] this._labelShowing');
}
if (result !== DragMotionResult.CONTINUE) {
this._updateCursor(DRAG_CURSOR_MAP[result]);
dragEvent.targetActor.disconnect(targetActorDestroyHandlerId);
- return GLib.SOURCE_REMOVE;
+ return;
}
}
}
0);
if (result !== DragMotionResult.CONTINUE) {
this._updateCursor(DRAG_CURSOR_MAP[result]);
- return GLib.SOURCE_REMOVE;
+ return;
}
}
target = target.get_parent();
}
this._updateCursor(Clutter.CursorType.NO_DROP);
- return GLib.SOURCE_REMOVE;
}
_queueUpdateDragHover() {
if (this._updateHoverId)
return;
- this._updateHoverId = GLib.idle_add(GLib.PRIORITY_DEFAULT,
+ this._updateHoverId = GLib.idle_add_once(GLib.PRIORITY_DEFAULT,
this._updateDragHover.bind(this));
GLib.Source.set_name_by_id(this._updateHoverId, '[gnome-shell] this._updateDragHover');
}
const shutdownId = global.connect('shutdown',
() => disableFile.delete(null));
- GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 60, () => {
+ GLib.timeout_add_seconds_once(GLib.PRIORITY_DEFAULT, 60, () => {
global.disconnect(shutdownId);
disableFile.delete(null);
- return GLib.SOURCE_REMOVE;
});
this._installExtensionUpdates();
// GJS finishes resolving this module.
imports._promiseNative.setMainLoopHook(() => {
// Queue starting the shell
- GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
import('./main.js').then(main => main.start()).catch(e => {
const error = new GLib.Error(
Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED, formatError(e));
global.context.terminate_with_error(error);
});
- return GLib.SOURCE_REMOVE;
});
// Run the meta context's main loop
_press(button) {
if (button === this.keyButton) {
- this._pressTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
+ this._pressTimeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT,
KEY_LONG_PRESS_TIME,
() => {
this._pressTimeoutId = 0;
this.keyButton.fake_release();
this._showSubkeys();
}
-
- return GLib.SOURCE_REMOVE;
});
}
}
if (!this._showIdleId) {
- this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
+ this._showIdleId = GLib.idle_add_once(GLib.PRIORITY_DEFAULT_IDLE, () => {
this.open(Main.layoutManager.focusIndex);
this._showIdleId = 0;
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._showIdleId, '[gnome-shell] this.open');
}
return;
}
- this._keyboardRestingId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
+ this._keyboardRestingId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT,
KEYBOARD_REST_TIME,
() => {
this._clearKeyboardRestTimer();
this._open();
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._keyboardRestingId, '[gnome-shell] this._clearKeyboardRestTimer');
}
return;
}
- this._keyboardRestingId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
+ this._keyboardRestingId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT,
KEYBOARD_REST_TIME,
() => {
this._clearKeyboardRestTimer();
this._close();
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._keyboardRestingId, '[gnome-shell] this._clearKeyboardRestTimer');
}
this._surroundingUpdateTimeoutId = 0;
}
this._surroundingUpdateTimeoutId =
- GLib.timeout_add(GLib.PRIORITY_DEFAULT, KEY_RELEASE_TIMEOUT, () => {
+ GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, KEY_RELEASE_TIMEOUT, () => {
func(text, cursor, cursor);
this._surroundingUpdateTimeoutId = 0;
- return GLib.SOURCE_REMOVE;
});
}
});
gcButton.connect('clicked', () => {
gcButton.child.icon_name = 'user-trash-symbolic';
System.gc();
- this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 500, () => {
+ this._timeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, 500, () => {
gcButton.child.icon_name = 'user-trash-full-symbolic';
this._timeoutId = 0;
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(
this._timeoutId,
this._updateMousePosition();
this._clearScrollContentsTimer();
- this._scrollContentsTimerId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, POINTER_REST_TIME, () => {
+ this._scrollContentsTimerId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, POINTER_REST_TIME, () => {
this._followingCursor = false;
if (this._xDelayed != null && this._yDelayed != null) {
this._scrollContentsToDelayed(this._xDelayed, this._yDelayed);
}
this._scrollContentsTimerId = 0;
-
- return GLib.SOURCE_REMOVE;
});
// Determine whether the system mouse pointer is over this zoom region.
endSessionDialog = new EndSessionDialog.EndSessionDialog();
// We're ready for the session manager to move to the next phase
- GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
Shell.util_sd_notify();
global.context.notify_ready();
- return GLib.SOURCE_REMOVE;
});
_startDate = new Date();
if (data.actor.mapped) {
_queueBeforeRedraw(workId);
} else if (_deferredTimeoutId === 0) {
- _deferredTimeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, DEFERRED_TIMEOUT_SECONDS, () => {
+ _deferredTimeoutId = GLib.timeout_add_seconds_once(GLib.PRIORITY_DEFAULT, DEFERRED_TIMEOUT_SECONDS, () => {
_runAllDeferredWork();
_deferredTimeoutId = 0;
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(_deferredTimeoutId, '[gnome-shell] _runAllDeferredWork');
}
delete this._updateDatetimeId;
} else if (!this._updateDatetimeId) {
this._updateDatetimeId =
- GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
delete this._updateDatetimeId;
this.datetime = GLib.DateTime.new_now_local();
- return GLib.SOURCE_REMOVE;
});
}
});
// We wait for a longer period if the notification popped up where the mouse pointer was already positioned.
// That gives the user more time to mouse away from the notification and mouse back in in order to expand it.
const timeout = this._useLongerNotificationLeftTimeout ? LONGER_HIDE_TIMEOUT : HIDE_TIMEOUT;
- this._notificationLeftTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, timeout, this._onNotificationLeftTimeout.bind(this));
+ this._notificationLeftTimeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, timeout, this._onNotificationLeftTimeout.bind(this));
GLib.Source.set_name_by_id(this._notificationLeftTimeoutId, '[gnome-shell] this._onNotificationLeftTimeout');
}
}
x < this._notificationLeftMouseX + MOUSE_LEFT_ACTOR_THRESHOLD &&
x > this._notificationLeftMouseX - MOUSE_LEFT_ACTOR_THRESHOLD) {
this._notificationLeftMouseX = -1;
- this._notificationLeftTimeoutId = GLib.timeout_add(
+ this._notificationLeftTimeoutId = GLib.timeout_add_once(
GLib.PRIORITY_DEFAULT,
LONGER_HIDE_TIMEOUT,
this._onNotificationLeftTimeout.bind(this));
this._updateNotificationTimeout(0);
this._updateState();
}
- return GLib.SOURCE_REMOVE;
}
// All of the logic for what happens when occurs here; the various
}
if (timeout > 0) {
this._notificationTimeoutId =
- GLib.timeout_add(GLib.PRIORITY_DEFAULT, timeout,
+ GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, timeout,
this._notificationTimeout.bind(this));
GLib.Source.set_name_by_id(this._notificationTimeoutId, '[gnome-shell] this._notificationTimeout');
}
this._lastSeenMouseX = x;
this._lastSeenMouseY = y;
- return GLib.SOURCE_REMOVE;
}
_hideNotification(animate) {
if (this._hideTimeoutId)
GLib.source_remove(this._hideTimeoutId);
- this._hideTimeoutId = GLib.timeout_add(
+ this._hideTimeoutId = GLib.timeout_add_once(
GLib.PRIORITY_DEFAULT, HIDE_TIMEOUT, this._hide.bind(this));
GLib.Source.set_name_by_id(this._hideTimeoutId, '[gnome-shell] this._hide');
}
global.compositor.enable_unredirect();
},
});
- return GLib.SOURCE_REMOVE;
}
_reset() {
if (targetIsWindow) {
this._lastHoveredWindow = dragEvent.targetActor._delegate.metaWindow;
- this._windowSwitchTimeoutId = GLib.timeout_add(
+ this._windowSwitchTimeoutId = GLib.timeout_add_once(
GLib.PRIORITY_DEFAULT,
DND_WINDOW_SWITCH_TIMEOUT,
() => {
this._windowSwitchTimestamp);
this.hide();
this._lastHoveredWindow = null;
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._windowSwitchTimeoutId, '[gnome-shell] Main.activateWindow');
}
if (this._xdndTimeOut !== 0)
GLib.source_remove(this._xdndTimeOut);
- this._xdndTimeOut = GLib.timeout_add(GLib.PRIORITY_DEFAULT, BUTTON_DND_ACTIVATION_TIMEOUT, () => {
+ this._xdndTimeOut = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, BUTTON_DND_ACTIVATION_TIMEOUT, () => {
this._xdndToggleOverview();
});
GLib.Source.set_name_by_id(this._xdndTimeOut, '[gnome-shell] this._xdndToggleOverview');
GLib.source_remove(this._xdndTimeOut);
this._xdndTimeOut = 0;
- return GLib.SOURCE_REMOVE;
}
});
const lockTimeout = Math.max(
adjustAnimationTime(STANDARD_FADE_TIME),
this._settings.get_uint(LOCK_DELAY_KEY) * 1000);
- this._lockTimeoutId = GLib.timeout_add(
+ this._lockTimeoutId = GLib.timeout_add_once(
GLib.PRIORITY_DEFAULT,
lockTimeout,
() => {
this._lockTimeoutId = 0;
this.lock(false);
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._lockTimeoutId, '[gnome-shell] this.lock');
}
if (params.fadeToBlack && params.animateFade) {
// Take a beat
- const id = GLib.timeout_add(GLib.PRIORITY_DEFAULT, MANUAL_FADE_TIME, () => {
+ const id = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, MANUAL_FADE_TIME, () => {
this._activateFade(this._shortLightbox, MANUAL_FADE_TIME);
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(id, '[gnome-shell] this._activateFade');
} else {
if (this._timeoutId)
return;
- this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 300, () => {
+ this._timeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, 300, () => {
this.opacity = 0;
this.show();
});
this._timeoutId = null;
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] tooltip.open');
}
try {
await this._grabHelper.grabAsync({actor: this});
} finally {
- GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
this.destroy();
- return GLib.SOURCE_REMOVE;
});
}
} finally {
this._previewCursor.destroy();
- GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
this.destroy();
- return GLib.SOURCE_REMOVE;
});
}
*/
export function sleep(milliseconds) {
return new Promise(resolve => {
- const id = GLib.timeout_add(GLib.PRIORITY_DEFAULT, milliseconds, () => {
+ const id = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, milliseconds, () => {
resolve();
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(id, '[gnome-shell] sleep');
});
_onSearchTimeout() {
this._searchTimeoutId = 0;
this._doSearch();
- return GLib.SOURCE_REMOVE;
}
setTerms(terms) {
this._updateSearchProgress();
if (this._searchTimeoutId === 0)
- this._searchTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 150, this._onSearchTimeout.bind(this));
+ this._searchTimeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, 150, this._onSearchTimeout.bind(this));
this._highlighter = new Highlighter(this._terms);
const items = this.menu._getMenuItems();
this.visible = alwaysShow || items.some(f => !!f.state);
-
- return GLib.SOURCE_REMOVE;
}
_queueSyncMenuVisibility() {
if (this._syncMenuVisibilityIdle)
return;
- this._syncMenuVisibilityIdle = GLib.idle_add(GLib.PRIORITY_DEFAULT, this._syncMenuVisibility.bind(this));
+ this._syncMenuVisibilityIdle = GLib.idle_add_once(GLib.PRIORITY_DEFAULT, this._syncMenuVisibility.bind(this));
GLib.Source.set_name_by_id(this._syncMenuVisibilityIdle, '[gnome-shell] this._syncMenuVisibility');
}
async _quitApp() {
this._spinner.play();
this._spinnerTimeoutId =
- GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, SPINNER_TIMEOUT,
+ GLib.timeout_add_seconds_once(GLib.PRIORITY_DEFAULT, SPINNER_TIMEOUT,
() => {
// Assume the quit request has failed, stop the spinner
this._spinner.stop();
delete this._spinnerTimeoutId;
- return GLib.SOURCE_REMOVE;
});
try {
_queueDevicesChanged() {
if (this._devicesChangedId)
return;
- this._devicesChangedId = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ this._devicesChangedId = GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
delete this._devicesChangedId;
this.emit('devices-changed');
- return GLib.SOURCE_REMOVE;
});
}
_hideIndicator() {
this.hide();
delete this._hideIndicatorId;
- return GLib.SOURCE_REMOVE;
}
_sync() {
const timeUntilHideUs =
MIN_SHARED_INDICATOR_VISIBLE_TIME_US - timeSinceVisibleUs;
this._hideIndicatorId =
- GLib.timeout_add(GLib.PRIORITY_DEFAULT,
+ GLib.timeout_add_once(GLib.PRIORITY_DEFAULT,
timeUntilHideUs / GLib.TIME_SPAN_MILLISECOND,
() => this._hideIndicator());
}
return;
this._enrolling = true;
- GLib.idle_add(GLib.PRIORITY_DEFAULT,
+ GLib.idle_add_once(GLib.PRIORITY_DEFAULT,
this._enrollDevicesIdle.bind(this));
}
const dev = devices.shift();
if (dev === undefined)
- return GLib.SOURCE_REMOVE;
+ return;
try {
await this._client.enrollDevice(dev.Uid, Policy.DEFAULT);
this._enrolling = this._devicesToEnroll.length > 0;
if (this._enrolling) {
- GLib.idle_add(GLib.PRIORITY_DEFAULT,
+ GLib.idle_add_once(GLib.PRIORITY_DEFAULT,
this._enrollDevicesIdle.bind(this));
}
} catch (error) {
this.emit('enroll-failed', null, error);
}
- return GLib.SOURCE_REMOVE;
}
}
const volumeChanged = this._stream.volume !== prevVolume;
if (volumeChanged && !this._notifyVolumeChangeId && !this._inDrag) {
- this._notifyVolumeChangeId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 30, () => {
+ this._notifyVolumeChangeId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, 30, () => {
this._notifyVolumeChange();
this._notifyVolumeChangeId = 0;
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._notifyVolumeChangeId,
'[gnome-shell] this._notifyVolumeChangeId');
// We delay showing the popup so that fast Alt+Tab users aren't
// disturbed by the popup briefly flashing.
- this._initialDelayTimeoutId = GLib.timeout_add(
+ this._initialDelayTimeoutId = GLib.timeout_add_once(
GLib.PRIORITY_DEFAULT,
POPUP_DELAY_TIMEOUT,
() => {
this._showImmediately();
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._initialDelayTimeoutId, '[gnome-shell] Main.osdWindow.cancel');
return true;
if (this._motionTimeoutId !== 0)
GLib.source_remove(this._motionTimeoutId);
- this._motionTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, DISABLE_HOVER_TIMEOUT, this._mouseTimedOut.bind(this));
+ this._motionTimeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, DISABLE_HOVER_TIMEOUT, this._mouseTimedOut.bind(this));
GLib.Source.set_name_by_id(this._motionTimeoutId, '[gnome-shell] this._mouseTimedOut');
}
_mouseTimedOut() {
this._motionTimeoutId = 0;
this.mouseActive = true;
- return GLib.SOURCE_REMOVE;
}
_isActorOutside(actor) {
if (this._noModsTimeoutId !== 0)
GLib.source_remove(this._noModsTimeoutId);
- this._noModsTimeoutId = GLib.timeout_add(
+ this._noModsTimeoutId = GLib.timeout_add_once(
GLib.PRIORITY_DEFAULT,
NO_MODS_TIMEOUT,
() => {
this._finish(global.display.get_current_time_roundtrip());
this._noModsTimeoutId = 0;
- return GLib.SOURCE_REMOVE;
});
}
if (workspace._keepAliveId)
GLib.source_remove(workspace._keepAliveId);
- workspace._keepAliveId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, duration, () => {
+ workspace._keepAliveId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, duration, () => {
workspace._keepAliveId = 0;
this._queueCheckWorkspaces();
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(workspace._keepAliveId, '[gnome-shell] this._queueCheckWorkspaces');
}
_windowRemoved(workspace, window) {
workspace._lastRemovedWindow = window;
this._queueCheckWorkspaces();
- const id = GLib.timeout_add(GLib.PRIORITY_DEFAULT, LAST_WINDOW_GRACE_TIME, () => {
+ const id = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, LAST_WINDOW_GRACE_TIME, () => {
if (workspace._lastRemovedWindow === window) {
workspace._lastRemovedWindow = null;
this._queueCheckWorkspaces();
}
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(id, '[gnome-shell] this._queueCheckWorkspaces');
}
this.actionMoveWorkspace(ws);
this._canScroll = false;
- GLib.timeout_add(GLib.PRIORITY_DEFAULT,
+ GLib.timeout_add_once(GLib.PRIORITY_DEFAULT,
SCROLL_TIMEOUT_TIME, () => {
this._canScroll = true;
- return GLib.SOURCE_REMOVE;
});
return Clutter.EVENT_STOP;
if (!win) {
// Newly-created windows are added to a workspace before
// the compositor finds out about them...
- const id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ const id = GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
if (metaWin.get_compositor_private() &&
metaWin.get_workspace() === this.metaWorkspace)
this._doAddWindow(metaWin);
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(id, '[gnome-shell] this._doAddWindow');
return;
if (this._timeoutId !== 0)
GLib.source_remove(this._timeoutId);
- this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, DISPLAY_TIMEOUT, this._onTimeout.bind(this));
+ this._timeoutId = GLib.timeout_add_once(GLib.PRIORITY_DEFAULT, DISPLAY_TIMEOUT, this._onTimeout.bind(this));
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._onTimeout');
this._redisplayAllPopups();
}
_onTimeout() {
- GLib.source_remove(this._timeoutId);
this._timeoutId = 0;
this.ease({
opacity: 0.0,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => this.destroy(),
});
- return GLib.SOURCE_REMOVE;
}
_onDestroy() {
if (!win) {
// Newly-created windows are added to a workspace before
// the compositor finds out about them...
- const id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ const id = GLib.idle_add_once(GLib.PRIORITY_DEFAULT, () => {
if (!this._removed &&
metaWin.get_compositor_private() &&
metaWin.get_workspace() === this.metaWorkspace)
this._doAddWindow(metaWin);
- return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(id, '[gnome-shell] this._doAddWindow');
return;